package com.mobileares.midp.mui.client.form;

import com.mobileares.midp.widgets.client.textbox2.BaseLabelList;
import com.wwfish.gwt.model.client.mui.FishWidget;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-11-25
 * Time: 8:57:00
 * To change this template use File | Settings | File Templates.
 */
public class BaseLabelListWrapper <X extends BaseLabelList> extends BaseLabelTextWrapper<X, List> {
    private boolean initList = false;

    BaseLabelListWrapper(FishWidget form, BaseLabelList widget, String field) {
        super(form, widget, field);
    }

    public void setValue(Object object) {
        if (!initList) {
            ddOutModel();
            initList = true;
        }
        super.setValue(object);
    }

    @Override
    public void ddOutModel() {
        getBMUI().initListCodes(getFishModel().getModel());
        Object value = form.getFishModel().getModel();
        super.setValue(value);
    }

}

